<template>
	<view class="content">
		<view class="flex flex-column" v-for="(item,index) in listName" :key="index">
			<view class="flex-line">
				<view>
					<!-- :color="activeIndex === index?'#007aff':'#8f8f94'" -->
					<uni-icons type="home" size="20" />
					<text class="line-font" @tap="goNextPage(item.id)">小案例----{{item.name}}----</text>
				</view>
				<view>
					<uni-icons type="arrowright" size="16" />
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import uniIcons from '@/components/uni-icons/uni-icons.vue'
	export default {
		components: {
			uniIcons
		},
		data() {
			return {
				listName: [{
					id: 1,
					name: "列表"
				}, {
					id: 2,
					name: "详情"
				}, {
					id: 3,
					name: "文字超出"
				}]
			}
		},
		methods: {
			goNextPage(pageIndex) {
				console.log("跳转哪个列表" + pageIndex);
				if (pageIndex === 1) {
					uni.showToast({
						title: "您现在就在列表页面",
						icon: 'none'
					})
				} else if (pageIndex === 2) { //跳转详情页面
					uni.navigateTo({
						url: '../details/details'
					})
				} else if (pageIndex === 3) {
					uni.navigateTo({
						url: '../text/text'
					})
				}
			}
		}
	}
</script>

<style>
	.content {
		margin: 0upx 30upx;
		border: 1upx solid #F8F8F8;
		background-color: #FFFFFF;
	}

	.box-shadow {
		box-shadow: 4upx 4upx 10upx rgba(0, 0, 0, 0.2);
	}

	.flex {
		display: flex;
	}

	.flex-column {
		flex-direction: column;
	}

	.flex-1 {
		flex: 1;
	}

	.flex-line {
		flex: 1;
		border: 1upx solid #999999;
		line-height: 70upx;
		height: 70upx;
		text-align: center;
		margin-bottom: 10upx;

		display: flex;
		flex-direction: row;
		justify-content: space-between;
		padding: 0upx 20upx;

		align-items: center;
	}

	.line-font {
		padding-left: 20upx;
		font-size: 34upx;
	}
</style>
